package com.sean.stock.controller;

import com.sean.stock.service.IStockService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/stock")
public class StockController {
    @Resource
    private IStockService stockService;

    @GetMapping("/reduce/{productId}")
    public String reduce(@PathVariable("productId") Long productId){
        stockService.reduce(productId);
        return "扣减库存成功！";
    }
}
